package Demo1;

import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;

public class ServletContextb extends GenericServlet {
    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();
        ServletContext application = this.getServletContext();

        out.print("this is "+application);

        Object object1 = application.getAttribute("userObj1");
        Object object2 = application.getAttribute("userObj2");
        System.out.println(object1);
        System.out.println(object2);
        out.print(object1);
        out.print(object2);

    }
}
